          
<script type="text/javascript" src="@{'/public/javascripts/jquery-1.6.4.min.js'}"></script>
<script charset="utf-8" src="@{'/public/javascripts/edit_tools/kindeditor-4.0.1/kindeditor-min.js'}"></script>
<script charset="utf-8" src="@{'/public/javascripts/edit_tools/kindeditor-4.0.1/lang/zh_CN.js'}"></script>
<link type="text/css" rel="stylesheet" href="@{'/public/indexFile/css/index.css'}" charset="utf-8"/>
<script type="text/javascript">
function lan(aaa){
        $.ajax({
               type:"POST",
               url:"@{ProgramaAction.test()}",
               dataType:"json",
               data:"id="+$(aaa).val(),
               success:function(data){
               if(data[0].id != "non"){
                   var opt = "";
	               for(var i=0;i<data.length;i++){
	                  if(opt == ""){
	                    opt = "<option value="+data[i].id+">"+data[i].proName+"</option>";
	                  }else{
	                    opt += "<option value="+data[i].id+">"+data[i].proName+"</option>";
	                  }
	               }
	                 $(aaa).nextAll().remove();
	                 $(aaa).after("&nbsp;&nbsp;<select name='proId' onchange='lan(this);'><option>请选择：</option>"+opt+"</select>");
               }else{
                     $(aaa).nextAll().remove();
               }
               }
        });
 }
</script>


<script type="text/javascript">
    $(function(){
    
          $("#dian").bind("blur",function(){
             if(isNaN($("#dian").val()))
             {
             alert("必须是数字");
             $("#dian").attr("value","");
             }
          })
          
          $("#bt1").click(function(){
          if($("#div1").is(":hidden")){
             $("#div1").show();
          }else{
             $("#div1").hide();
          }
          })

          $("#bt2").click(function(){
          var la = "";
          var i = 0;
             $("input[type='checkbox']:checked").each(function(){
             if(i == 0){
                       la = $(this).val();
             }else{
                       la = la+","+$(this).val();
             }
                 i++;
             });
          var aa = $("#newTag").val();
          if(aa == ""){
               aa = la;
          }else if(la == ""){
          }else{
              aa = aa+","+la;
          }
          $("#newTag").val(aa);
          $("#div1").hide();
          })
          
          $("#xin").change(function(){
            if($("#Det").is(":hidden")){
               $("#Det").show();
            }else{
               $("#Det").hide();
            }
          })
    })
</script>
<div style="margin:10px auto; width:500px;">
	<form action="@{create()}" method="post">
	  #{if flash.success}
	  <p><font color="red">${flash.success}</font></p>
	  #{/if}
	  <p style="margin-left:10px;color:#666666;">请选择所属栏目：
		<select style="width:150px;" name="proId" onchange="lan(this);">
		          <option>请选择：</option>
				#{list items:programas,as:'programa'}
				  <option value=${programa.id}>${programa.proName}</option>
				#{/list}
			</select>
		</p>
	    <div class="m2_b_c1">
	    	<div class="m2c_a">新闻标题：</div>
	        <div class="m2c_b"><input name="news.newTit" type="text"/></div>
	    </div>
	    <div class="m2_b_c1">
	    	<div class="m2c_a">新闻代码：</div>
	        <div class="m2c_b"><input name="news.newCode" type="text"/></div>
	    </div>
	    <div class="m2_b_c1">
	    	<div class="m2c_a">来&nbsp;&nbsp;&nbsp;&nbsp;源：</div>
	        <div class="m2c_b"><input name="news.newSou" type="text"/></div>
	    </div>
	    <div class="m2_b_c1">
	    	<div class="m2c_a">关&nbsp;键&nbsp;字：</div>
	        <div class="m2c_b"><input name="news.newKws" type="text"/></div>
	    </div>
	    <div class="m2_b_c1">
	    	<div class="m2c_a">点&nbsp;击&nbsp;量：</div>
	        <div class="m2c_b"><input id="dian" type="text" name="news.newHits" type="text"/></div>
	    </div>
	  <p style="margin-left:16px;color:#666666;">状&nbsp;&nbsp;&nbsp;&nbsp;态：<input id="sta" type="checkbox" value="1" name="news.newSta">新闻置顶</p>
	  <p style="margin-left:16px;color:#666666;">类&nbsp;&nbsp;&nbsp;&nbsp;型：<select id="xin" name="news.newTyp">
	               <option value="0" selected="selected">普通新闻</option>
	               <option value="1">标题新闻</option>
	          </select>
	  </p>
	  <p style="margin-left:16px;color:#666666;">标签选择：<input type="text" name="news.newTag" id="newTag">
	    <!-- -->
	              <input type="button" value="选择" id="bt1">
	  </p>
	  <!-- -->
	  <div STYLE="border-style:solid;border-width:1pt; border-color:green;width: 41%;display: none;" id="div1">
	  <p>
	         <input type="checkbox" value="资讯">资讯
	         <input type="checkbox" value="11">11
	         <input type="checkbox" value="22">22
	         <input type="checkbox" value="33">33
	         <input type="checkbox" value="新书">新书
	         <input type="checkbox" value="最新">最新
	         <input type="checkbox" value="ss">ss
	         <input type="checkbox" value="99">99
	         <input type="checkbox" value="88">88
	         <input type="checkbox" value="00">00<br/>
	         <input type="checkbox" value="新闻">新闻
	         <input type="checkbox" value="热门">热门
	         <input type="checkbox" value="头条">头条
	         <input type="checkbox" value="44">44
	         <input type="checkbox" value="44">44
	         <input type="checkbox" value="44">44
	         <input type="checkbox" value="44">44
	         <input type="checkbox" value="4g">4g
	         <input type="checkbox" value="44">44
	         <input type="checkbox" value="44">44
	  </p>
	  <p><input type="button" value="确定" id="bt2"></p>
	  </div>
	  <p style="margin-left:10px;color:#666666;" id="Det">新闻详情：
	  <textarea rows="10" cols="70" id="newDet" name="news.newDet"></textarea>
	  </p>
	  <p style="margin-left:560px;"><input type="submit" value="添加"></p>
	</form>
	<p><a href="/controllers/NewsAction.list">返回</a></p>
</div>


<script type="text/javascript" defer="defer">
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[id="newDet"]', {
			resizeType : 2,
			allowPreviewEmoticons : false,
			allowImageUpload : false,
			items : [
				'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|', 'emoticons', 'image', 'link','table','map','|','source','fullscreen' ]
		});
	});
	function editor_add_html(txt){
		// 取得HTML内容
		var htmlX = editor.html();
		// 设置HTML内容
		//editor.html( htmlX + "<br>" + txt );
		//将指定的HTML内容添加到编辑区域的最后位置。
		//editor.appendHtml(txt);
		//插入内容
		editor.insertHtml(txt);
	}
</script>